from django.db import models
import django.utils.timezone as timezone
# Create your models here.

class ab_aggregation(models.Model):
    """
    系统 system_type
    模块 module_name
    异常简述 abnormal_des
    异常描述 abnormal_des
    服务器地址 ip_addr
    解决方式 solution
    次数 number
    删除 is_delete
    创建时间 createDate
    修改时间 modifyDate
    """
    id = models.BigAutoField(max_length=30, primary_key=True)
    system_type = models.CharField(max_length=255)
    module_name = models.CharField(max_length=255)
    abnormal_des = models.TextField()
    abnormal_paper = models.CharField(max_length=255)
    solution = models.TextField()
    ip_addr = models.CharField(max_length=255)
    number = models.IntegerField()
    is_delete = models.IntegerField(default=0)
    createDate = models.DateTimeField(default=timezone.now)
    modifyDate = models.DateTimeField(auto_now=True)

    class Meta:
        db_table = "ab_aggregation"

# class ab_module_rule(models.Model):
#     id = models.BigAutoField(max_length=30, primary_key=True)
#     system = models.CharField(max_length=255)
#     module = models.CharField(max_length=255)
#
#     class Meta:
#         db_table = "ab_aggregation"